added kill_port function;