added delete and toggle function