handle some errors