Changed function to get the right javascript's path