reworked for postgre
reworked for postgre