tidied up userconnection code