fixed refresh and login issue