the conditinal if(dynamicModel != null) was throwing an exception even when dynamicModel was null.....