use a better way to ensure the command substituion works