fix bugs in servlet