add some result checking