add dir and dir guard