Fixed some bugs while testing

a lot of bugs in code coz of our knowledge of python is small like my
english