check isfile before read