Add some error handling for text input