fixing extra space problem