Updated text and added null checks