Modified for socket testing