correct error handeling