Added check for presence of modules