add max in js_header and remove code