fix #302
Fix #277