code refactoring
fixed: error messages append with +=