adding id check function