Fix JacaScript code order