Added check for existence of result