Pass instance of main class