Fixed id checking