fix a wrong type bug (backport)