Moved session part to mongoose connection CallBack function.