Fixed synchronization between spinner and database initialization