handling some errors