add check_function functionality