fixed quit message handling