modified exception handling in SocketParser