Bugfix: check for null