Fixed Javascript error