modified for servlets