fixes for the mod code