fixed loop after error message