fixed the DB performance issues