Updated check for better script inclusion between header / footer