fix ACT-1731 and add testcase
 Please enter the commit message for your changes. Lines starting