added some business logic for toastr to work properly.