null check condition added