fixed Cmd_app
fixed initialization of some global variables and the sdcard