Fix resource check