minor bugs fixed

changes to run cmd function, TcpListner