fix tests
use custom exceptions