[FIX] nullpointer
[CHG] better logging