update demo to check isFile after capture