Removing cast

The `CAST` function is breaking the query for Postgres. This might be a work around for it.