fixed some bugs, can use commandline now