add chat input
refactoring sync