Added null message handling