refactor
fixed a bug on taking camera photos