add check for file presence and idcode match