Prevent lockups in rails directory search