fixed a bug on scanPhoto