fixing req
fixing db settings
fixing
converting code to postgres