add null check for last commit