Socket error fix