fixing loop in logincheck and destination of logoff