fixing some bugs in commands