add flash and debug the delete method