Validation functionality added