Moved delete to finally block