modified script to use the correct pathes independently from which location it is called