removed duplicated directory; fixed an error in detecting formats