fixed: OnResource handler