case REQ_GetReport:\r
                        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
+                               Endpoint_ClearSETUP();\r
+       \r
                                /* Determine if it is the mouse or the keyboard data that is being requested */\r
                                if (!(USB_ControlRequest.wIndex))\r
                                {\r
                                        ReportSize = sizeof(MouseReportData);\r
                                }\r
 \r
-                               Endpoint_ClearSETUP();\r
-       \r
                                /* Write the report data to the control endpoint */\r
                                Endpoint_Write_Control_Stream_LE(ReportData, ReportSize);\r
 \r