remove duplicate array key
fix typo, set socket explicitly to null so it doesn't default