validation logic added for form