Fix bug in user management