Added lookups to make sql work