Catch socket timeout error

Needs to be verified if this actually catches the error and if it doesn't cause double callbacks.