fix omniauth failure in some cases