corrected fs handling to avoid app rejection from apple