simplify: some error handling