added file helper function