Updated detect to add tags to tag library