enhanced user-friendliness of error pages. enabled login redirect to previous page