Fixed database creation serious bug