Added code to try to catch authentication crash