fixed a bug in the python module