change tag to tags, fix a lot of bugs