Added fix for postgres error