fix bug for nested modules