fix reading functional data