Fixing issue with typeExists()