add some error handelling