changed logick of Prepare in Handler.ServeHTTP