remove redundant directory check