js fix on cookie