added form validation and error messaging in views