implemented replace attribute