bug fixes, prep for saving data