fixing python attribute bug