Adding null checks