null bug fixed by making typ lazy