fixed __resourceType checking issue