fix deleting array and test