fixed bug. set up database