added an error check conv. method.