remove element and prepare to append element