update
fixed bugs
update to error handling