Error when trying to query by id