fixed more issues with table sql..