create another method for errors