moved sockect init into beginApplication