Updated with database selection