Revert "Modify logic from prependTo to appendTo"

This reverts commit 98b27b07ff017a65d4a3ac69168d97b4135cd12f.