Fixed type cast error that occurs with tomcat 7