fixed currentTarget and String.replace capture value differences between browsers