saveToDatabase works