Added condition so that text cannot be longer than the textbox itself