function to determine path to public directory