type changed to main, database creation added