fix bug on camera capture