Adding directory check back in