added the first check for unreachable workspace.

returns nan result