modified for class server