Webdriver cannot set preference to Firefox


I was trying to set a preference “network.proxy.type”=1 to Firefox with this code:

{-# LANGUAGE OverloadedStrings #-}

module Main where

import           Test.WebDriver
import           Test.WebDriver.Firefox.Profile

main :: IO ()
main = do
    let profile = addPref "network.proxy.type" (PrefInteger 1) defaultProfile
    preparedProfile <- prepareProfile profile
    let config = defaultConfig {wdCapabilities = defaultCaps {browser = firefox {ffProfile = Just preparedProfile}}}
    runSession config $ return ()

When the code run, Firefox opened up, and I went to “about:config” and searched for “network.proxy.type”. It said that “network.proxy.type” = 5. What did I do wrong?