Append messages errors on the correct element

related to https://github.com/HeHStudy/HeH/issues/1845