added command line argument checks