added session.forget()
added conditional in order to load scheduler's functions only by the scheduler