Added errorCallback for getDirectory