fixed possible NullPointerException