added function to apply realtime notification(messageSent and
responseSent).