modified classpath and added exception handling in dijkstra