added a result guard check