Fix code for multiple tags