fix save method; add getLastID method