use invokeAndWait for setting listener that cancels read action before write action start