Fix for java.lang.NumberFormatException: For input string: ""