make it work for just one dir