fixed postgres, added templates