added a new method: error