fixes to layout and fixed database back to postgresql