fix table populate and wrap around