fix null pointer for situation when call registered function from console