Removing previous modules directory, added file check