Fix main in hook example