Reverted to the old version of the file directly quick fixing the bug as I'm not able to build a working version from FileAPI