adding null checks