pre event of p5 runs the check method