added NIO to removing method