Added missing database queries