bugfix: null safe check for targets