fixes for mongodb and pgsql