fix a bug when taking several pictures