Updated the code to accept filepath from monitor class.