Add socket variables and change template