made the worker have a timeout in the loop, in order to prevent it to loose the connection.