fix javascript lag