Updated for database