removed delete tag bug by adding function