Added a check for null master when no master is loaded