Added a catch for NumberFormatException