position checking added