Fixed memory error in accessing static server table, and added code for detected if a server is already connected.