Validation functionality added.