fix dom manipulation
use already existing head var