Adding code to handle null value