fix some warrning and code