checkResources()

as separate function