using exception for os match detection