CRM-13738 related fix

Please check the issue comments for the changes done