fixing the width calculation bug
extra space added