Added missing table and renamed some variables
Added missing database attribut to the parent