connect to database in new Thread (for faster loading);