bugfix: null reference catching