add setTimeout to wait input completed