added resource logic