Adding changes to fix camera crash in landscape mode