make certain to only add file to dir once dir is created