Fix bug in sock