fix tomcat bugs