fix bugs
refactor