did some improvment for ticket https://issues.jboss.org/browse/RAILO-2896