Re-Added database regeneration on close lines (for demo)