added an util function