Removed infinite loop (forever) from sessionMainLoop.