added automatic shutter code