adding in replace option but it's not working