changed from sqlite to postgresql