fixing the issue#240 and new UT for the same