added if statement to only grabpdfs