changed connection.end to release