better solution for preserving permissions during flush