Please only do this when status is 404, it might significantly reduce the number of times this code is called.