login logout functions fixed