replace now works on selection as well as the whole canvas