Fixed replace to be global