added basic validation and modified the view