Fixed database readonly issue.