fix some errors & improve some stuff