fix #2718 for warning about unused variable