fix #3735 (assertion failure)