Did you override $model->save()? If so, remember to have it return true (or false) at the end. That’s bitten me a couple of times too. A function that doesn’t return anything will not pass an if() test.
Moreover can anybody tell me hw to go back to the previous application… I tried redirect function but not properly. I have to also post some data back to the previous application