rewrite check method