fix some bugs add some stuff