updated for errors