fix javascript for copies