add reply logic