put js in header to prevent firefox bug