change server to singleton