modification in the code to include class dynamically