added local version of _check_func