add id check function.