Fixed nil value when when textfield is empty