fix NullpointerException in unittest