fixed crashing in camera preview