Minor change to sql procedure to skip nulls