Found a bug in replace. Turns out I never made the mouse press event over enter do anything. It now does the replace function