Solving bug on database initialization