added new method to send path to the function