added basic user validations and flash messages