replace is working properly now