fix session issue and change command line check