this is kind of ugly condition