tidy up readdir callback