fix #4036 (same as #4026)