fix issue #614
fix issue #613