patching method that was failing on empty array