New module system and fixed a bug