save Function added to contorller