bug fixed when deleting tag and minor changes