fixing python errors