made some changes to cope with failures