#19 changes
#19 more error handling fixes