added code to error