allow to set resource via callback in dm.resource() call