Replaced call to deprecated with_scope