adding null check