 			else draggingFn = moveCropZone
 			draggingFn(e)
 		scope.mouseup = (e) -> 
-			draggingFn(e)
+			draggingFn(e) if draggingFn
 			draggingFn = null
 		scope.mousemove = (e) ->
 			draggingFn(e) if draggingFn

		if scope.ratio and not scope.height
			scope.height = scope.destinationHeight
		scope.type ||= "png"

	template: """
		<div

					checkVRatio()

		isNearBorders = (coords) ->
			offset = offset imageAreaEl
			x = scope.xCropZone + offset.left
			y = scope.yCropZone + offset.top
			w = scope.widthCropZone
			h = scope.heightCropZone
			topLeft = { x: x, y: y }
