bug fix in quit session