Fixed js to update on copy-paste