fixed critical bugs for commands not working properly