handle first msg from server, custom exception class, no useless try-excepts, minor cleanup and typo fix