Improved the waitTask method ensuring it sleeps 100ms before recalling the API