added error message if the program is run incorrectly
improved error message