because it calls connection.end outside the callback function