need to work in main and init