added error checking for input and dive default
Merge pull request #4 from EdglLau/TableChanges

added error checking for input and dive default