added check for text field