fixed some stupid write calls and fixed the javascript committed by.. *drumroll*