updated with USE_FREERTOS