fixed the adding to table. stil learning js :)