Fixed the Segmentation Fault

Just added a do while loop to check for an empty enter. Don't know if
anything is broken because of this since I still don't have an good
understanding of the code.