Modified app to use postgresql