add view_on_success option
fix indentation