Workaround to avoid mousedown event from being executed twice