added not null check