fix for redmine #2635
(cherry picked from commit 49018b38e52f81b0d0f3b663e32fcbcb6544ce23)