fix test to check for the right exception