Fix socket bind erros

Fixes socket bind errors by rebinding to the socket. Thanks to @p1gl3t for mentioning this fix to me.