check create and delete in one method

currently we have not check the varivale correctness.