Fix error when running a command