load resource properly.