Added checks for command line arguments