tweak some codes