Bugfix: prevent NullPointerException