fix the tests and fix the component
trevor wrote some tests that function