JS replace only does the first instance :-(