some filename & directory check added