overhaul aio implementation for correctness