made script work with single filename