add fail handler for loader