optim and correction of servlet