error check for invalid user to trigger logout