added user validations and edit functionality