implementing multi session support almost finished