added exit to null checks