Fix bug when creating or editing users