Added a confirm dialog before saving in lending and return view

Closes #542