Fixed crash sometimes with uncaught exception