handle the unusual situation
change the mode to realize fingleton
change the code of session.pyand implify it
add logging