defer conn.Close for simplicity and remove unnecessary goroutines, improve error handling (close #12)