Fix for occasional crash