added option to return array of items ($ref)