change directories matcher logic