added try catch blocks so gui wont crash when wrong data is entered into
text fields.