Fixed bug related to use of extra user defined code