Fixed incorrect use of delete statement