change error handle slightly