refactor + error change