changed check of last commit to ItemID instead of reference