improve session start logic