delete array function