Added check for change of position