null check added