fixing a flatten