You should flip this line and the next--otehrwise, if the deletion throws an error, the user will still get the message.