fixes refresh and login problems