fixed bugs that appeared after fixing other bugs