Fixed a bug where replaceOnce wasnt working