fix bugs in removeChild