Remove the final "/" for the "dist" parameter (need improvement)