fixes error on trying to respond with http 401