check function