fix faulty handling of results