introducing database access and switch status