save function checks if already saved