Moved try/catch

Moved Try/catch to catch the socket.timeout error that keeps getting
thrown in the comment for loop