catch file related errors