fixing bugs on cmd mode