should write a test for this