fixed up commit grabbing logic