Made an error log end the logic loop.