use event handler for mouseup instead of jquery bindings