updated for database establishment