Added function to edit and add users