fix for ends of modules