session start improved to use register and unregister