Fixed time errors on ruby and javascript side