added save attempt function