revise some codes