Fixing the attribute error problem