Proper connection cleanup