fix select coordinate math