javascript treshold fixed (now with lower)