corrected the exit bug and added cmdline