fixed dynamic reader

fixed the seg fault in the dynamic reader