bug fixes for creating a table