added check to add a leading 0 if needed