add read file function