Adding not null assert to avoid nullpointer