properly end modules

to get rid of compile errors