fixes incorrect exception in test