Handling other errors during loop