fix a lot of issues