updated database to have getLastError()