Fixed database refresh error