Fix bug when running module under cli