Fixed error in postgres where fields from translate where injected for a count query