Delete token upon request error and fix token on query param