Define resource first