fixed user logout, and validation