fix problem with replace