add 2 new command, fix several bugs and security flaw