fix build, fix null reference exception