change require order to prevent segfault