 				@visibleModal = true
 				@toggleOverlayStatus()
 
-				@disposables.push modal.onDidChangeVisible => @checkModals()
+				@subscriptions.add modal.onDidChangeVisible => @checkModals()
 
 	checkModals: ->
 		visibleModal = false

			@workspace.setAttribute DATA_STATUS, @visibleModal

	destroy: ->
		disposable.dispose() for disposoable in @disposables

module.exports = ModalHandler
{CompositeDisposable} = require 'atom'

DATA_STATUS = 'outlander-visible-modal';

class ModalHandler
	visibleModal: false

	constructor: ->
		@subscriptions = new CompositeDisposable

		workspace = document.querySelector('atom-workspace')

		if workspace
