FREEPBX-6165 #resolve - fix incorrect array index causing the work folder to be overwritten