fix #1018
fix #1016