updated ioport functions