fixed onpart and onnick bug