fix ordering and missing dependancies