fixed sending a close notify message as fatal and using a wrong record
type