fix error scenario in tests