fix bug in insert/select and added delete database calls