Added more error checking, and a different save button