added a waitFor, to wait for the command