added flag to tell if photo is being taken