Added a function to verify text input