 			e.stopPropagation()	
 
 		removeLightbox: ->
-			$('.drm-blackout').fadeOut(drmLightbox.config.speed).remove()
+			$('.drm-blackout').fadeOut drmLightbox.config.speed, ->
+				$(@).remove()
 	}
 
 	drmLightbox.init()

			# html for the actual lightbox
			lightboxHtml = "<div class='drm-blackout'><button class='close'>x</button><img src='#{img}' alt='thumbnail' class='img-visible'><ul class='thumbnail-list'>#{thumbnails}</div>"

		addLightbox: (e) ->
			lightbox = $ '.drm-blackout'
			lightboxHtml = drmLightbox.createLightbox()

			# if the lightbox isn't already showing, append it to body and fade it into view
			if lightbox.length == 0
				$(lightboxHtml).hide().appendTo(body).fadeIn drmLightbox.config.speed

			e.preventDefault()


###############################################################################
# Displays a lightbox with an image slideshow built with images from a 
# thumbnail set
###############################################################################

( ($) ->
