move parent tag to the end