ticket3. Fix bugs with old data