fix some warn and bugs