Improved a loading metabox function