simplified code to use same page for creating and updating users