added null guard to Command<>