added checkResources

added checkResources function