added an example for nulls
added error handling capabilities