changed save functions in controller