fixed null pointer on save. added save all functionality