added visible check for mouseup handler