change how it gets dir so that we can actually use glob patterns