Fix IdentityMap middleware

Correct clear identity map object after every request