fix bugs and add nupnp