add rebot logic and store at mongodb