Adding check for the text field being empty