updating code to work wit FileObject and fixing tests