an else case is missing here and probably untested