[TRUNK-3499] made some changes to my previous commit