DOM node manipulation - Bug Fix