Database and first Alert loop