Fix resourceexists bug.