added save safely