including check to see if file exist
input argument checking and error checking