Implemented task retry system in case the task is not able to complete
the execution at first attempt.
Improved check task status management in case the task returns an error.