validation function added