Fixed typeExists issue