finished resource checking, but it's untested