modified to ignore the target folder