fixed nullptr exception