Fix for java.lang.NullPointerException: println needs a message