fix in position update for dem.h