messages saving locally using sqlite