fixes bug in import modules function