fixing initial setting of offset