fixed possibility of empty hsurf