added exception mechanism