added node struct and fixed data read issue