same change as in master branch (fix the issue reported in mantis 3923)