added replaceStr function