Introduced retry on connection
Invalid status
Code cleaning