error function, message on close or server down