 					timer: 1000
 					showConfirmButton: false
 
-				instance.chatMessages.deleteMsg(message)
+				chatMessages[Session.get('openedRoom')].deleteMsg(message)
 		validation: (message) ->
 			return RocketChat.authz.hasAtLeastOnePermission('delete-message', message.rid ) or RocketChat.settings.get('Message_AllowDeleting') and message.u?._id is Meteor.userId()
 		order: 2
RocketChat.MessageAction = new class
	buttons = new ReactiveVar {}
	
	###
	config expects the following keys (only id is mandatory):
		id (mandatory)

		i18nLabel: 'Edit'
		action: (event, instance) ->
			message = $(event.currentTarget).closest('.message')[0]
			chatMessages[Session.get('openedRoom')].edit(message)
			$("\##{message.id} .message-dropdown").hide()
			input = instance.find('.input-message')
			Meteor.setTimeout ->
