copy-paste double error in javascript