Added error handling to user input in main
Added error handling to getData