fix for possible NullPointerException