Added a function to remove extra slashes from path