fix bugs that were found