fixed bugs with python errors