flag to check directory or not