Updated database saving and loading