added handling for null value returns