fix minors bugs