Moved the print statement outside the if/else logic