Fixes the Array Issue when Deleting the Element and Storing in the Database