using thread.sleep on exceptions