fix #2041 issues