missed out a nil check, caused crash