updated to move functionality for save into seperate controller