Fix for https://www.pivotaltracker.com/s/projects/838407/stories/59497438 added logic to check if input has content or not to control the close