fixed a NullPointerException