Fixed Class Issue

When i add a class array in add_input function. the class attribute is not printed. its fixed by adding some fixes in this code.