fix some strange bugs