Changes made to make the adddata work.

Undef variable bug however doesnt seem to affect the data from being
pushed to the table...