complete function buy item