Null checks added