fix array deletion