flatten fix