Added write and read from DB