Added tcontent.contentid to select statement