Issue: incorrect handling of mouseup event