removing extra space and closing center tag