calculating length of settings string and removed not workong replace