fixed some command bugs and logging