updated error handling and messaging
removed erroneous puts statement