fix from 2.4 port to master