Change delete to delete[] for char[]