changed one error to exception to reveal the problem