fixed some bugs in system commands