only set result if error isn't true