Fix resize and destroy from socket