improving error/warning handling