Trying to fix javascript, 3rd times a charm?