fix camera release and photo taken racing condition