adding form validation mechanism