Added condidtional statement for null