minor changes, error catches and toggle improvements