Adds classpath
Catches NullPointerException in hasEnded function