 
 
   def handle_call({:destroy_sessions, pid}, _from, state) do
-    if HashDict.has_key?(state, pid) do
+    if Map.has_key?(state, pid) do
       sessions = state[pid][:all_sessions]
       Enum.each sessions, fn({_session_name, session_id})->
         Hound.Session.destroy_session(session_id)
       end
-      state = HashDict.delete(state, pid)
+      state = Map.delete(state, pid)
     end
     {:reply, :ok, state}
   end

    session_id = pid_info[:all_sessions][session_name]

    if session_id do
      pid_info_update = HashDict.put(pid_info, :current, session_id)
    else
      {:ok, session_id} = Hound.Session.create_session(driver_info[:browser])

      all_sessions_update = HashDict.put(pid_info[:all_sessions], session_name, session_id)
      pid_info_update = pid_info
        |> HashDict.put(:current, session_id)
        |> HashDict.put(:all_sessions, all_sessions_update)
    end

    new_state = HashDict.put(state, pid, pid_info_update)
    {:reply, session_id, new_state}
  end


  def handle_call({:all_sessions, pid}, _from, state) do
    if HashDict.has_key?(state, pid) do
      {:reply, state[pid][:all_sessions], state}
    else
      {:reply, [], state}

  use GenServer

  def start_link do
    state = %{}
    :gen_server.start_link({:local, __MODULE__}, __MODULE__, state, [])
  end

