moved from sqlite to pg