patching detectorhit nullpointer exception