Logic added for deleting extra tags and saving page_id.