Fix nasty nullpointerexception