fixed properly with a test