more robust workspace checking