Fix Javascript error