work on #311
fix #311