fixed possible NullpointerException