Add storing in DB and logging