get main working properly