cleaned up test to throw better exception