fixed poiner errors