Adding check id function