One more fix in javascript slider calculation