Better error checking for  call