Add error checking for deletion.