add method save to IndexController