some server detection stuff