added validation for position