fixed postgres warning and made heatmap more flexible