You attempted to use the delete statement to delete a scalar variable.
Only use delete to delete arrays and array element.