Fixing buffer alert string replace issue