added key lookup to prevent duplicate scripts