changed get latest commit function