trap loading errors