fixed memory leak in server