Fixed auth issue on refresh