improve user management function