add open file implementation