replace ctype test with a function to check proper type of region id