Added if for validating