Update File System call to write to file

Fixed errors related to first start, and file not found