improvements on basic filter and better exception handling on servlet security mechanism