added delete messages and some error proofing