some javascript corrections