fixed errors with createDB and struct type mismatch