updated the util function