fix problem running commands when not in interactive mode