changes to error checking
merge