Added the hasResource(name) function.