added run fails if cmd nil test
added run fails if cmd nil test