check for not result instead of result === undefined