fixed infinite loop on loading saved session