modified UAIFile implementation according to the comments