Fixed minor bug in newIdExists always reterning true