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

This did the trick for me.