Implement some validation logic