implemented session persistence