add some error handling to util