added paper capture function and flash