Get rid of that client.close(), it's unnecessary.