fix bugs
select by database instance