fix error (null pointer) when call registered command from console