fixing a few issues that came of the code review