main enabled and fixed other bugs