fixed the NullPointerException