fixed calculation of latest tag