send informative error to the server and close when aborting and some minor fixes