fixing a bunch of issues