Error add and refactoring