fixed infinite loop locking threads on 404 and other < 500 errors