fixed insert alarm javascript