stops errors if reply is undefined (can happen if root directory is empty)