fixing order of commands