Added restoration of session if unavailable